package tk.mybatis.mapper.mapperhelper;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


/**
 * 
 * title: NestdEntityHelper.java 
 * description
 *
 * @author rplees
 * @email rplees.i.ly@gmail.com
 * @version 1.0  
 * @created Jul 3, 2016 10:14:17 PM
 */
public final class ExampleValidatorHelper {
	static Map<String, ExampleValidator> map = new ConcurrentHashMap<String, ExampleValidator>();
	public static ExampleValidator getExampleValidator(Class<?> entityClass) {
		String canonicalName = entityClass.getCanonicalName();
		if(map.containsKey(canonicalName)) {
			return map.get(canonicalName);
		}
		
		map.put(canonicalName, new ExampleValidator(entityClass));
		return map.get(canonicalName);
	}
}